#!/bin/bash
#&#126976; -> &#127019;

red="rgb(206, 0, 0)"
green="#00651b"
blue="#2a5978"
brown="#593211"
gray="#222530"




text_color=$red
shadow_color="#7f7f7f"

text_a1='	<text text-anchor="middle" font-family="freeserif,symbola" font-size="75" y="69.17335" x="30.79788" stroke-width="0" fill="'$text_color'" stroke="#000000" id="svg_37" transform="matrix(1.0108697926531107,0,0,1.0260877133977355,-0.3342608393762063,-1.8519674994400532) " font-weight="normal">'
text_a2='</text>'
text_b1='	<text text-anchor="middle" font-family="freeserif,symbola" font-size="78" id="svg_1" y="69.62206" x="30.47737" stroke-width="0" fill="'$shadow_color'" stroke="#000000">'
text_b2='</text>'

img_folder="/tmp/tiletest/"


trash="$HOME/.local/share/Trash/files"

trash_dir="Tiles_deleted"$(date --date='now' +%Y.%m.%d_%H:%M:%S)

`cd $trash; mkdir "$trash_dir";`;
for file in `cd tiletest; ls`
do
	mv "$img_folder/$file" "$trash/$trash_dir"
done


for (( i=126976; i<=127019; i=i+1 ))
do
	tile_name="Tile0"
	if [ $((i-126976 < 10)) == 1 ];then
		tile_name="$tile_name""0" 
	fi
	tile_name=$tile_name$((i-126976))
	
	cat svg-part1  >> "$img_folder/$tile_name.svg";
	echo "$text_b1&#$i;$text_b2"  >> "$img_folder/$tile_name.svg";
	echo "$text_a1&#$i;$text_a2" >> "$img_folder/$tile_name.svg";
	cat svg-part2 >> "$img_folder/$tile_name.svg";
	
done
